package com.example.sb.mapper;

import com.example.sb.entity.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface UserMapper {

    @Insert("insert into `user` (username,password,name,phone,email,address,avatar,role)" +
            "values (#{username},#{password},#{name},#{phone},#{email},#{address},#{avatar},#{role})")
    void insert(User user);

    @Update("update `user` set username = #{username} where id = #{id}")
    void updateuser(User user);

    @Delete("delete from `user` where id = #{id}")
    void deleteUser(Integer id);
}
